const fs = require('fs')
const path = require('path')

// 确保目标目录存在
const distDir = path.join(__dirname, '../dist')
const iconsDir = path.join(distDir, 'icons')
if (!fs.existsSync(iconsDir)) {
  fs.mkdirSync(iconsDir, { recursive: true })
}

// 复制manifest.json
fs.copyFileSync(
  path.join(__dirname, '../manifest.json'),
  path.join(distDir, 'manifest.json')
)

// 复制图标
const icons = ['16', '48', '128']
icons.forEach(size => {
  fs.copyFileSync(
    path.join(__dirname, `../public/icons/icon${size}.png`),
    path.join(distDir, `icons/icon${size}.png`)
  )
})

console.log('Assets copied successfully!') 